//
//  ViewController.m
//  ZXT
//
//  Created by 张逸阳 on 2017/8/15.
//  Copyright © 2017年 dr. All rights reserved.
//

#import "ViewController.h"
#import "LineView.h"
@interface ViewController ()
@property(nonatomic ,strong) LineView *lineView;
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor grayColor];
    
    NSMutableArray *xArray = [NSMutableArray array];
    NSMutableArray *yArray = [NSMutableArray array];
    
    

    for (NSInteger i = 0; i <= 30; i++) {
        
        
//        [xArray addObject:[NSString stringWithFormat:@"%.1f",0+0.1*i]];
        [xArray addObject:[NSString stringWithFormat:@"%@",@"2017-01-01"]];
        [yArray addObject:[NSString stringWithFormat:@"%.2lf",100.0+arc4random_uniform(100)]];
    }
    
    
    
    NSMutableArray *arrA = [NSMutableArray array];
    NSMutableArray *arrB = [NSMutableArray array];
    
    for (NSInteger i = 0; i <= 30; i++) {
        [arrA addObject:[NSString stringWithFormat:@"%.2lf",100.0+arc4random_uniform(100)]];
    }
    
    for (NSInteger i = 0; i <= 30; i++) {
        [arrB addObject:[NSString stringWithFormat:@"%.2lf",100.0+arc4random_uniform(100)]];
    }
   
    self.lineView = [[LineView alloc] initWithFrame:CGRectMake(10, 200, self.view.frame.size.width-20, 300) xTitleArray:xArray yValueArray:yArray yValueArrayA:arrA yValueArrayB:arrB yMax:203 yMin:-231];
    
    
    
    
    
    [self.view addSubview:self.lineView];
    
}

//- (LineView *)lineView
//{
//    if (!_lineView) {
//        _lineView = [[LineView alloc] initWithFrame:CGRectMake(10, 200, self.view.bounds.size.width - 20  ,400 )];
//        [self.view addSubview:_lineView];
//        _lineView.backgroundColor = [UIColor whiteColor];
//    }
//    return _lineView;
//}

@end
